9000 PRINT "Lxref",TIME$:DEF SEG:B=PEEK(47)*256+PEEK(46)
9010 DEFINT I-K:LOCATE ,,0:H=VARPTR(#1)+51:POKE H,6
9020 FOR I=H+1 TO H+252:POKE I,1:NEXT:POKE I,0
9030 POKE I+2,0:POKE H+11,2:POKE H+12,2:POKE H+13,3
9040 POKE H+14,3:POKE H+15,0:POKE H+132,6:POKE H+143,6
9050 POKE H+28,2:POKE H+29,4:POKE H+31,8:POKE H+34,5
9060 POKE H+209,9:I=0:J=0:K=0:F=B
9070 B=PEEK(49)*256+PEEK(48):C=B:A=B:DIM B(999),A(999)
9080 A=PEEK(B+1)*256+PEEK(B):B=B+3:C=PEEK(B)*256+PEEK(B-1)
9090 IF C<F THEN PRINT C;:LOCATE ,1 ELSE 9210
9100 B=B+1
9110 K=PEEK(H+PEEK(B))
9120  ON K GOTO 9100,9140,9170,9140,9150,9160,,9140
9130 B=B+2:GOTO 9110
9140 B=B+PEEK(H+PEEK(B))+1:GOTO 9110
9150 B=B+1:IF PEEK(B)=34 THEN 9100 ELSE IF PEEK(B) THEN 9150
9160 B=A:GOTO 9080
9170 A(I)=C:B(I)=PEEK(B+2)*256+PEEK(B+1)
9180  FOR J=I TO 1 STEP-1:K=(B(J)<B(J-1))
9190   IF K THEN SWAP B(J),B(J-1):SWAP A(J),A(J-1) ELSE J=0
9200  NEXT:I=I+1:B=B+3:GOTO 9110
9210 H=I-1:FOR I=0 TO H:IF A(I)<0 THEN 9240 ELSE PRINT B(I),
9220  FOR J=I TO H:IF B(I)=B(J) THEN PRINT A(J);:A(J)=-1
9230  NEXT:PRINT:H=H+(A(H)<0)
9240 NEXT:PRINT TIME$:END
